#include<stdio.h>

int n;
int a[4] = { 153,370,371,407 };
int b[3] = { 1634,8208,9474 };
int c[3] = { 54748,92727,93084 };
int d[1] = { 548834 };
int e[4] = { 1741725,4210818,9800817,9926315 };

void find()
{
    if (n == 3)
        for (int i = 0; i < 4; i++)
            printf("%d\n", a[i]);
    if (n == 4)
        for (int i = 0; i < 3; i++)
            printf("%d\n", b[i]);
    if (n == 5)
        for (int i = 0; i < 3; i++)
            printf("%d\n", c[i]);
    if (n == 6)
        for (int i = 0; i < 1; i++)
            printf("%d\n", d[i]);
    if (n == 7)
        for (int i = 0; i < 4; i++)
            printf("%d\n", e[i]);
}

int main()
{
    scanf("%d", &n);
    find();
    return 0;
}